import React from "react";
import ReactDOM from "react-dom/client";
import { createBrowserRouter, RouterProvider } from "react-router-dom";
import { ConfigProvider, App } from "antd";
import zhCN from "antd/locale/zh_CN";
import createAppRoutes, { baseRoutes } from "./routes";
import GlobalMessageProvider from "./components/GlobalMessageProvider";
import "antd/dist/reset.css";
import "./styles/global.scss";

const router = createBrowserRouter(createAppRoutes());

ReactDOM.createRoot(document.getElementById("root")!).render(
  <React.StrictMode>
    <ConfigProvider locale={zhCN}>
      <App>
        <GlobalMessageProvider>
          <RouterProvider router={router} />
        </GlobalMessageProvider>
      </App>
    </ConfigProvider>
  </React.StrictMode>
);
